<template>
    <div class="out-box">
        <img alt="" :src="src" class="img"/>
        <el-tooltip class="front" content="点击移除此图片">
            <i class="el-icon-close" @click="$emit('click',src)"></i>
        </el-tooltip>
    </div>
</template>

<script>
    export default {
        name: "UploaderPreviewer",
        props:{
            src:{
                require: true,
                type: String
            }
        },
    }
</script>

<style scoped>
    .img{
        width: auto;
        height: 100%;
    }
    .out-box{
        position: relative;
        border-radius: 4px;
        width: fit-content;
        overflow: hidden;
    }
    .front{
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        display: none;
        background-color: #606266cc;
        cursor: pointer;
        color: white;
        font-size: 2em;
    }
    .out-box:hover .front{
        display: block;
    }
</style>